Skip to content

Update SDK to bring in RSG one assembly changes #30827

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 8 commits into from

Conversation

captainsafia
Copy link
Member

No description provided.

@ghost ghost added the area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework label Mar 11, 2021
@captainsafia captainsafia force-pushed the safia/update-sdk-one-asm branch 5 times, most recently from e8e97c7 to 21d3307 Compare March 15, 2021 19:01
@captainsafia
Copy link
Member Author

Closing in favor of merging this into #30891.

@captainsafia captainsafia reopened this Mar 17, 2021
@captainsafia captainsafia force-pushed the safia/update-sdk-one-asm branch 2 times, most recently from 872e461 to e5e3473 Compare March 17, 2021 20:09
@captainsafia captainsafia force-pushed the safia/update-sdk-one-asm branch from e5e3473 to 4986a10 Compare March 17, 2021 21:19
@captainsafia captainsafia added area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates and removed area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework labels Mar 17, 2021
@captainsafia captainsafia marked this pull request as ready for review March 17, 2021 22:44
@captainsafia captainsafia removed request for a team and halter73 March 17, 2021 22:44
<AddRazorSupportForMvc>true</AddRazorSupportForMvc>
<NoWarn>RS0016</NoWarn>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The build for this codepath relies on the RazorPageDocumentClassifier which we didn't update to support consolidated views. As a result, the types generated in the output assembly are still public and picked up by the public API analyzer during the build.

I fixed this in this PR but we'll need to wait for the aspnetcore -> SDK -> installer flow with this change to finish before we can remove this check.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough. I would block on that, but it's good that we picked it up quickly

*REMOVED*Microsoft.AspNetCore.Mvc.Razor.Extensions.MvcViewDocumentClassifierPass.MvcViewDocumentClassifierPass() -> void
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eh, since we're doing this in multiple classes now I think using a constructor that takes a flag will be better than duplicating the code to avoid ragrets later.

@@ -0,0 +1,4 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yarn expects there to be a lock file even it if is empty. Commiting this to avoid the annoyance of always having this as an untracked file.

<AddRazorSupportForMvc>true</AddRazorSupportForMvc>
<NoWarn>RS0016</NoWarn>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough. I would block on that, but it's good that we picked it up quickly

@@ -31,14 +31,8 @@ public WebAuthenticationTests(WebApplicationFactory<Startup> fixture)
public static TheoryData<string> NotAddedEndpoints =>
new TheoryData<string>()
{
"/AzureAD/Account/AccessDenied",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happened here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, previously, the Azure AD UI projects used a NullApplicationFactory and instead relied on their own logic to discover the application parts from the related assembly (see https://github.com/dotnet/aspnetcore/pull/31039/files#diff-754ffcfbe4655cc4cca0a446a4f1b0eb3552a8795c136385b6ffad03259e0a7dL199). This API gets invoked from the AddAzureAD extension method.

Since the views are compiled into the app assembly and we are no longer using the NullApplicationFactory, we don't need to rely on the discovery logic (I removed it in the new PR above).

The controllers don't change though because those are discovered with a feature provider that exists outside of the views story.

@@ -47,7 +47,7 @@ public static IdentityBuilder AddDefaultUI(this IdentityBuilder builder)
private static readonly IDictionary<UIFramework, string> _assemblyMap =
new Dictionary<UIFramework, string>()
{
[UIFramework.Bootstrap4] = "Microsoft.AspNetCore.Identity.UI.Views.V4",
[UIFramework.Bootstrap4] = "Microsoft.AspNetCore.Identity.UI.",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this goes away. This used to switch the related part but we're not generating any now.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep. You're right. I should've looked way closer at this. I made the appropriate changes in #31039.

.GetRelatedAssemblies(GetType().Assembly, throwOnError: true)
.SingleOrDefault();
foreach (var part in CompiledRazorAssemblyApplicationPartFactory.GetDefaultApplicationParts(relatedAssenbly))
foreach (var part in CompiledRazorAssemblyApplicationPartFactory.GetDefaultApplicationParts(Assembly.GetExecutingAssembly()))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't the consolidated part factory already take care of this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does. However, this particularly startup logic removes all the discovered application parts and adds its own.

.ConfigureApplicationPartManager(manager => manager.ApplicationParts.Clear())

I think it does this to validate the behavior of the specific extension methods used here.

Comment on lines +42 to +43
builder.Features.Add(new RazorPageDocumentClassifierPass(useConsolidatedMvcViews: true));
builder.Features.Add(new MvcViewDocumentClassifierPass(useConsolidatedMvcViews: true));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
builder.Features.Add(new RazorPageDocumentClassifierPass(useConsolidatedMvcViews: true));
builder.Features.Add(new MvcViewDocumentClassifierPass(useConsolidatedMvcViews: true));
builder.Features.Add(new RazorPageDocumentClassifierPass(builder.Configuration.UseConsolidatedMvcViews));
builder.Features.Add(new MvcViewDocumentClassifierPass(builder.Configuration.UseConsolidatedMvcViews));

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't need the if

@@ -0,0 +1,4 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BrennanConroy why do you do this to us?

@captainsafia
Copy link
Member Author

@pranavkm I closed this PR yet again since we pulled out the consolidated view stuff. New PR is at #31039.

@captainsafia captainsafia deleted the safia/update-sdk-one-asm branch June 11, 2021 02:27
@github-actions github-actions bot locked and limited conversation to collaborators Dec 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants